//
//  XZDiscoverViewController.m
//  IBeeBo
//
//  Created by Sean on 16/4/4.
//  Copyright © 2016年 Sean. All rights reserved.
//

#import "XZDiscoverViewController.h"
#import "XZUISearchBar.h"


@interface XZDiscoverViewController ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation XZDiscoverViewController

- (void)viewDidLoad {
    [super viewDidLoad];
     XZLog(@"发现模块创建一次");
    
    
    [self setSearchbar];
   
    
}
/**
 *  自定义搜索框
 */
- (void)setSearchbar{
    //创建搜索对象
    XZUISearchBar *searchbar = [XZUISearchBar searchBar];
    searchbar.width = 300;
    searchbar.height = 30;
    
    //添加到navigationItem.titleView
    self.navigationItem.titleView = searchbar;
}
#pragma mark--UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 20;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *CellID = @"Discover";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellID];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellID];
    }
    
    cell.textLabel.text = [NSString stringWithFormat:@"Discover%ld",indexPath.row];
    
    
    return cell;
    
}
@end
